package cn.iocoder.yudao.module.famous.doctor.dal.mysql.banner;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.famous.doctor.dal.dataobject.banner.FamBannerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.famous.doctor.controller.admin.banner.vo.*;

/**
 * 名医-轮播图 Mapper
 *
 * @author 档案
 */
@Mapper
public interface FamBannerMapper extends BaseMapperX<FamBannerDO> {

    default PageResult<FamBannerDO> selectPage(FamBannerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FamBannerDO>()
                .eqIfPresent(FamBannerDO::getDeviceType, reqVO.getDeviceType())
                .eqIfPresent(FamBannerDO::getType, reqVO.getType())
                .eqIfPresent(FamBannerDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(FamBannerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FamBannerDO::getId));
    }

    default List<FamBannerDO> selectList(FamBannerExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FamBannerDO>()
                .eqIfPresent(FamBannerDO::getDeviceType, reqVO.getDeviceType())
                .eqIfPresent(FamBannerDO::getType, reqVO.getType())
                .eqIfPresent(FamBannerDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(FamBannerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FamBannerDO::getId));
    }

}
